package org.agony2d.view
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import org.agony2d.view.supportClasses.AbstractImageButton;
	import org.agony2d.view.supportClasses.ImageButtonProp;
	
	import org.agony2d.core.agony_internal;
	use namespace agony_internal;
	
final public class ImageButton extends AbstractImageButton 
{
	
	public function ImageButton( dataName:String, isCenter:Boolean = false )
	{
		super(dataName, isCenter);
	}
	
	
	override agony_internal function onRelease() : void
	{
		m_bitmap.bitmapData = m_prop.release
	}
	
	override agony_internal function onPress() : void
	{
		m_bitmap.bitmapData = m_prop.press
	}
	
	override agony_internal function onLeave() : void
	{
		if (this.pressed)
		{
			m_bitmap.bitmapData = m_prop.leave
		}
	}
	
	override agony_internal function onHover() : void
	{
		if (this.pressed)
		{
			m_bitmap.bitmapData = m_prop.hover
		}
	}
	
	override agony_internal function onInvalid() : void
	{
		m_bitmap.bitmapData = m_prop.invalid
	}
}
}